﻿using IM.Easy.Core.SeedData;
using IM.Easy.Entity.System;
using SqlSugar;

namespace IM.Easy.Api.SeedData
{
    public class DictDataSeedData : MemorySeedData<SysDictData>
    {
        public override int Execute(SqlSugarScope db)
        {
            var data = Read();
            var count = 0;
            if (data.Count > 0)
                count = db.Insertable(data).ExecuteReturnSnowflakeIdList().Count;
            return count;
        }

        public override List<SysDictData> Read()
        {
            List<SysDictData> list = [];

            list.Add(new SysDictData { Group = "sys_data_type", Value = "0", Label = "字符串", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_data_type", Value = "1", Label = "数值", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_data_type", Value = "2", Label = "布尔值", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_normal_disable", Value = "true", Label = "启用", CssClass = "success", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_normal_disable", Value = "false", Label = "禁用", CssClass = "danger", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_show_hide", Value = "true", Label = "显示", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_show_hide", Value = "false", Label = "隐藏", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "log_error_type", Value = "0", Label = "系统异常", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "log_error_type", Value = "1", Label = "业务异常", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_login_terminal", Value = "0", Label = "电脑", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_login_terminal", Value = "1", Label = "手机", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "gen_func", Value = "add", Label = "添加", CssClass = "success", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "gen_func", Value = "update", Label = "修改", CssClass = "primary", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "gen_func", Value = "del", Label = "删除", CssClass = "danger", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "gen_func", Value = "view", Label = "查看", CssClass = "primary", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_yes_no", Value = "true", Label = "是", CssClass = "success", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_yes_no", Value = "false", Label = "否", CssClass = "info", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "code_lang", Value = "json", Label = "json", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "code_lang", Value = "text", Label = "文本", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_notice_effective", Value = "0", Label = "未生效", CssClass = "primary", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_notice_effective", Value = "1", Label = "生效中", CssClass = "success", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_notice_effective", Value = "2", Label = "已过期", CssClass = "warning", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_notice_status", Value = "0", Label = "草稿", CssClass = "success", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_notice_status", Value = "1", Label = "已发布", CssClass = "success", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_notice_status", Value = "2", Label = "已撤回", CssClass = "warning", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_priority", Value = "0", Label = "普通", CssClass = "primary", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_priority", Value = "1", Label = "重要", CssClass = "warning", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_priority", Value = "2", Label = "紧急", CssClass = "danger", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "external_platform", Value = "Gitee", Label = "Gitee", CssClass = "info", ListClass = "text", ThemeClass = "light" });
            list.Add(new SysDictData { Group = "user_creation_source", Value = "System", Label = "系统初始化", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "user_creation_source", Value = "Registered", Label = "自主注册", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "user_creation_source", Value = "Manual", Label = "管理员分配", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "user_creation_source", Value = "Gitee", Label = "Gitee登录创建", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_user_sex", Value = "0", Label = "男", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_user_sex", Value = "1", Label = "女", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_user_sex", Value = "2", Label = "未知", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "file_category", Value = "text", Label = "文本类", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "file_category", Value = "image", Label = "图像类", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "file_category", Value = "audio", Label = "音频类", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "file_category", Value = "application", Label = "应用类", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "file_category", Value = "video", Label = "视频类", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "file_category", Value = "font", Label = "字体类", CssClass = "info", ListClass = "text", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_result", Value = "true", Label = "成功", CssClass = "success", ListClass = "tag", ThemeClass = "dark" });
            list.Add(new SysDictData { Group = "sys_result", Value = "false", Label = "失败", CssClass = "danger", ListClass = "tag", ThemeClass = "dark" });
            return list;
        }
    }
}
